<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>comment</title>
<style type="text/css">
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,form,fieldset,p,button,table,th,td{margin:0;padding:0}
body,h1,h2,h3,h4,th,td,input{font-family:"돋움",dotum,sans-serif;font-size:12px;font-weight:normal}
body{background:#fff}
table{border-collapse: collapse; border-spacing: 0}
img,fieldset{border:0}
ul,ol,li{list-style:none}
img,input,select,textarea{vertical-align:middle}
a{color:#262626;text-decoration:none;}
a:hover{color:#4559E9;text-decoration:underline}
a.ir:hover{text-decoration:none}
label{cursor:pointer;}
body{background-color:#d0d8e8;}


#wrap{width:400px; margin:100px auto;}
h1{text-align:center;font-size:36px;margin-bottom:20px;font-weight:bold;}
.input{margin-bottom:20px;font-weight:bold;}
.input .txtbox{margin-bottom:10px;padding:5px 10px;border:3px solid #385d8a;border-radius:10px;font-size:14px;width:100px;}
.input .txtArea{padding:5px 10px;border:3px solid #385d8a;border-radius:10px;width:374px;font-size:14px;}

.output{margin-bottom:10px;padding:10px 20px;border:3px solid #385d8a;border-radius:10px;background-color:#4f81bd;color:#fff;font-weight:bold;}
.output .userName{font-size:14px;font-weight:bold;color:#000;}
.output .countBt{text-align:center;}
.output .countBt button{width:80px; height:25px;}
.output .comment{font-size:18px;margin-bottom:10px;}
</style>
</head>
<body>
<div id="wrap">
	<div>
		<h1>Cheer up!</h1>
		<form:form method="post" action="main" >
			<table class="input">
				<tr>
					<td><input class="txtbox" name="name" type="text" placeholder="사용자 이름" /></td>
				</tr>
				<tr>
					<td><textarea class="txtArea"cols="44" rows="5" name="comment" placeholder="150자 이내의 댓글을 입력하세요." ></textarea></td>
				</tr>
				<tr>
					<td align="center">
						<input type="submit" value="글쓰기" action="main" method="GET" />
						<input type="reset" value="취소" />
					</td>
				</tr>
			</table>
		</form:form>
		
		<c:forEach items="${comments}" var="cm" >
			<div class="output">
				<div>
					<p class="userName">${cm.name}</p>
					<p>${cm.regdate}</p>
					<p class="comment">${cm.comment}<input type="submit" value="삭제" /></p>
					<p class="countBt"><button>힘내! (0)</button>&nbsp;&nbsp;&nbsp;<button>분발해 (0)</button></p>
				</div>
			</div>
		</c:forEach>
		
	</div>
	<form action="join" method="GET">
		<input type="submit" value="회원가입">
	</form>
</div>

</body>
</html>